/* A very basic doubly-linked list for page table caps */
#ifndef SOS_PT_LIST_H
#define SOS_PT_LIST_H

#include <cspace/cspace.h>
#include <libut.h>
#include <sel4/sel4.h>

typedef struct sos_pt_list {
    seL4_Word paddr;
    seL4_CPtr cap;
    struct sos_pt_list *next;
    struct sos_pt_list *prev;
} sos_pt_list;

/**
 *  Add a single cap with its vaddr to the list.
 *  This function does not perform any mapping - caller should do that.
 */
int sos_pt_list_insert(seL4_Word paddr, seL4_CPtr cap, sos_pt_list **list);

/**
 *  Unmap and destroy every page table in the list.
 */
int sos_pt_list_destroy(sos_pt_list **list);

#endif // SOS_PT_LIST_H
